package com.ruoyi.factory.ykj.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.factory.qylock.utils.SignHelper;
import com.ruoyi.factory.ykj.service.LoginByCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

/**
 * @ClassName toThirdPartGetAuthJHaveCode
 * @Description: TODO 免登认证
 * @Author LiuJiaji
 * @Date 2023/4/21 0021 15:08
 **/
@RestController
@RequestMapping("/api/loginByCode")
public class LoginByCodeController {

    @Autowired
    private LoginByCodeService loginByCodeService;

    /**
     * @author: Liujiaji
     * @date: 2023/4/21 0021 15:18
     * @description: TODO 根据code获取信息
     * @param: [code]
     * @return: void
     **/
    @PostMapping("/getInfoByCode")
    @ResponseBody
    public AjaxResult getInfoByCode(@RequestBody Map<String,String> request){
        return loginByCodeService.getInfoByCode(request);
    }

    public static void main(String[] args) {
        String token = SignHelper.getToken();
        System.out.println("友空间接口生成的token "+token);
    }

}
